The details of phase information are lost in the use of mean filtering algorithm to repair singular point by using Stoilov phase shift algorithm, which leads to incorrect phase calculation. In order to solve this problem, a new weighted mean filtering algorithm based on short distance priority was proposed. First, singular points were marked by statistical approach. Then, the size of filter window, which was built basing on the short distance priority principle for each singular point, was up to the number of non-singular points and the shortest distance in current situation. Last, this algorithm used the weighted mean of the non-singular points in the window instead of the singular point to implement singular point correction. The experimental results show that window is more detailed in this method, and the proposed method can effectively remove impulse noise, especially may have advantage in protecting details of phase, and may reduce Root Mean Squared Error (RMSE) less than 0.06 cm in the actual measurement experiments.